You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.2 KiB

1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # VMS Backend
  2. **goals to be met**:
  3. <ul>
  4. <li> <s>Create and set up main database on a PostgreSQL server</s> </li>
  5. <li> <s>Set up basic GET requests for Users, Vehicles, Assignments</s> (except for Assignments) </li>
  6. <li> <s>Set up POST requests for Users, Vehicles, Assignments</s> (except for Assignments) </li>
  7. <li> <s>Add token/cookie(?) authentication</s> </li>
  8. <li> !!! Fully read the pdf document and build the database schema !!! </li>
  9. </ul>
  10. # Let's keep updating this readme.md file as we complete our tasks
  11. ## How to launch
  12. First, make sure that python is installed. Create a virtual environment (if you want to)
  13. ```
  14. python -m venv venv
  15. source /venv/bin/activate
  16. ```
  17. (not necessary)
  18. run the docker image provided to launch postgresql (telegram)
  19. install dependencies:
  20. ```
  21. pip install -r requirements.txt
  22. ```
  23. open terminal in the **app** directory, and launch with:
  24. ```
  25. uvicorn main:app --reload
  26. ```
  27. OR
  28. ```
  29. python3 -m uvicorn main:app --reload
  30. ```
  31. ## Explaining the file structure
  32. ```
  33. app //main app
  34. |-alembic //Alembic -- database migration manager. Helps keep databases in sync and changeable (handles all SQL logic and keeps everything up-to-date)
  35. | |- //All files irrelevant
  36. |-apis //Stores the actual API Endpoints.
  37. | |-v1 //Main API endpoints
  38. |-core //Core project components
  39. |-db //Stores database information and data
  40. | |-models //Stores database models (represents SQL Tables)
  41. | |-repository //Stores scripts to create, update and interact with the database
  42. |-schemas //Stores Pydantic data models (Kind of like db/models except for use in the API itself, not just the database. Uses for data validation and stuff)
  43. ```
  44. ## Git Guide
  45. - [Git Reference](http://git.github.io/git-reference): despite its name it is more of a user guide.
  46. - ["Pro Git" Book](http://git-scm.com/book): by a core developer, also a thorough user guide.
  47. - [Git Documentation](http://git-scm.com/documentation): the official reference (also accessible with `git help command`)
  48. - [Think Like a Git](http://think-like-a-git.net/): a course for "advanced beginners" that know basic committing but want to make sense of the Git model. Especially useful if you come from SVN to really clear misconceptions about git.
  49. - [Git Concepts Simplified](http://gitolite.com/gcs/): Similar to the previous link, but less in-depth and more straightforward.
  50. - [Git Immersion](http://gitimmersion.com/): learn Git by using it on carefully crafted examples of increasing complexity.
  51. - [Git from the bottom up](http://ftp.newartisans.com/pub/git.from.bottom.up.pdf): A book to learn git by first understanding the simplicity and beauty of its internals.
  52. - [Git Magic](http://www-cs-students.stanford.edu/~blynn/gitmagic/): complete opposite of "Git from the bottom up" in that it treats Git as a magical gizmo you'll learn to use without drowning into the underlying storage and history model.
  53. - [Git questions on StackOverflow](http://stackoverflow.com/questions/tagged/git): comprehensive coverage of advanced matters.
  54. - [Top 10 Git Tutorials for Beginners](http://sixrevisions.com/resources/git-tutorials-beginners/): A list of tutorials and resources. Contains another list of far more than 10 sites at the end.