Giter Club home page Giter Club logo

pvz-svc's Introduction

pvz-svc

FastApi logo

FastApi + Mongo REST API wiki about Plants Vs Zombies videogame

Get started

Unix

Install poetry:

curl -sSL https://install.python-poetry.org | python3 -

Init repo:

poetry new pvz-svc

Create the virtual env folder:

mkdir .venv

Install all the dependencies in the project (clean-state):

poetry install

Install any dependency you need:

poetry add lib_here

Remove a dependency you don't need:

poetry remove lib_here

Set up

env

Activate using the command:

source .venv/bin/activate

Exit virtual env:

exit

or

deactivate

Advanced use cases

If multiple python versions are found in the operative system, then

  • use pyenv to handle the versions
  • if needed set the local python for this project, like
pyenv local 3.12.1
  • you can confirm all good by checking
pyenv which python
  • set the specific python version like
poetry env use $USER_HOME/.pyenv/versions/3.12.1/bin/python
  • then install using commands like the ones in the previous section

Windows

Update pip:

py -m pip install --upgrade pip

Install python3-venv:

py -m pip install virtualenv

Then create the folder for allocate the virtual environment:

py -m virtualenv env

Optional (run if UnauthorizedAccess in powershell console):

Set-ExecutionPolicy Unrestricted -Scope Process

Then activate the virtual env:

.\venv\Scripts\activate.ps1

Now you can install python libs as you need it

set up

Configure all your dependencies in Pipfile. See: Pypi

dependencies

For generate requirements.txt file please execute:

pip3 freeze > requirements.txt

docs

Open {base_url}/docs while running to access swagger instance Open {base_url}/redoc while running to access redoc instance

launch

You might need to create a DB in Atlas Mongo, then please reference .env.sample, to create your own .env file with the relevant database info. Once ready you can do the following to launch:

cd src
uvicorn main:app --reload

test

cd src
pytest

Web deployment

This app can be hosted in Railway, folder that helps with it is .ci folder.

List of cool technologies in use here

License

MIT licensed.

Stay in touch

pvz-svc's People

Contributors

gal16v8d avatar

Watchers

 avatar

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.