Coder Social home page Coder Social logo

hired-api's Introduction

Hired Django RESTful App

This is the back-end counterpart to the full-stack Hired React App. A full description of the app can be found there.

Project Setup

  1. Please Note that you must place the following steps in a separate directory from the front end app!!!!

  2. Clone the repo and cd into it:

    git clone [email protected]:kurtkrafft1/Hired-API.git

  3. Navigate to the root directory: cd Hired-API

  4. Set up your virtual environment:

    python -m venv hiredEnv

  5. Activate virtual environment:

    source ./hiredEnv/bin/activate

  6. Install dependencies:

    pip install -r requirements.txt

  7. I had to manually connect to the database a few times so you're going to have to set that up really quick so follow these instructions

  8. In the root directory (the one you should be in) enter this: touch hiredapp/views/connection.py

  9. hit then code . or some way to open your text editor to the root directory.

  10. find that connection file the path is this hiredapp/views/connection.py

  11. in that file enter the following code:

     class Connection:
         db_path = "Your db.sqlite3 path here"
    
  12. make sure that the spacing is correct and that db_path is indented

  13. In the terminal now we can run migrations:

    python manage.py makemigrations python manage.py migrate

  14. Now that you have this set up go back to your text editor that you opened earlier and you should see a file called "db.sqlite3" right or cmd click that file and hit 'copy path'

  15. navigate back to the connection.py file and past that path where it says "your DB path here" keeping the quotation marks

  16. in your terminal it is time to load fixtures:

    python manage.py loaddata */fixtures/*.json

  17. Start the API server:

    python manage.py runserver

  18. Follow the steps on the front-end web app readme to view the web app in your browser

Technology Utilized

  1. Django
  2. Python
  3. SQLite
  4. Fixtures
  5. ORM & SQL queries
  6. Models
  7. API Endpoint Views
  8. User authentication with authtoken
  9. url routing

Made By:

![ERD] (https://github.com/kurtkrafft1/Hired-API/blob/master/images/erd.png?raw=true)

hired-api's People

Contributors

kurtkrafft1 avatar

Watchers

James Cloos avatar  avatar

hired-api's Issues

Jobs tab

Given:
The user opens the My Jobs tab they will be directed to a page showing all of their job profiles
When: The user clicks the edit icon on their job they will be directed to a page where they can edit that profile
Then: It will submit a put request to the API and update their job and redirecting them to their job page with the updated job
Given:
The user wants to add a new job profile
When: The user clicks the plus icon and can then create a new job for themselves
Then: They should be able to specify their pay (per job or hourly) and also add the following information:
Job type (drop down menu)
Job title
Job Description

Given:
The user wants to delete a job profile
When: The user clicks the trashcan Icon
Then: the page refreshes and will no longer show that profile

Endpoints

  • employee Profiles (for user)
  • edit, delete, retrieve, create, list

Past Jobs Page

Given:
The user goes to the Past Jobs page
When: The user can click either "For You" or "By You" and see past jobs based of that criteria
Then: It is just List methods with a specific token to get the user and then a single parameter to tell the api whether to fetch the user by user_id or employee_id

Endpoints

  • customer_id 1 (option 1)
  • raw sqlite3 query joining with customer_employeeProfileId (option 2)

HomePage

Given:
The user has logged in or registered
When: they log in and are redirected to the home page

Then: They see a fixed sidebar with the following options (Home, My Jobs, Past Employees, Messages, Profile, and Logout). They also see any current employees, the last person they employed, and a snippet of there profile and if anyone has reached out to them to hire.

endpoints

  • current employees
  • last employeed person
  • user info

Messages

Given:
The user wants to hire someone
When: The user clicks the message button on the details page for a potential employer
Then: The user will be redirected to a message between them and the potential employer
behind the scenes: The second the user clicks the message button a post request will be made starting that job however, the start_date will not be filled until the user clicks hire on the message board. This will be how we group messages; by job_id.

Given:
The user opens the Messages tab
When: The user can view all messages between them and either past employees or employers. They will see the name of the other person, the job title, and the last message. lastly a button.
Then: This button will direct the user to the previously mentioned message board between two users grouped by job_id.

Endpoints

  • Employees tab where its messages to people you employ customer_id
  • Employers tab where its messages to people who employ you receiver_customer_id (swap)
  • Each message chain will be filtered by job_id

Login/Register

Given: The user wants to view the page
When:
The user opens the site he or she is given the option to login or register
Then: they click login (with correct credentials) they will get moved to the dashboard
or they will hit register and register and then get pushed to the dashboard

Search page

Given:
The user is looking for some one to come take a job for them so they click the search tab
When: The user is directed to the search page sees two search bars at the top one for city and one for job title
Then: When the user submits the form a list of potential matches will show up and the user can click on those to view a details page for that employee profile where they can message that potential employer and offer to hire them

Endpoints

  • by title
  • by job type (stretch goal)
  • by city
  • by all three (or any combo)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.