/c3py

Excuse me, sir. I'm a python boilerplate. 🚀 🐍

Primary LanguagePythonMIT LicenseMIT

CodeFactor

C3PY

Excuse me, sir. I'm a python boilerplate.

The main goal of C3PY is to set patterns to be easily implemented on Python projects. We want to make easy to quick start a Python enviroment with the basic resources every project could have. Check out the patterns we defined this document bellow.

It was inspired by Nodevader.


Icon by Filipe Carvalho

Startup

Step by step to get this up and running

Clone repo and go to project folder

git clone https://github.com/c3py/c3py.git && cd c3py

Install dependencies

pip3 install -r requirements.txt

Get enviroment variables

cp .env.template .env

Start server

python3 src/app.py

Via docker-compose (start database, run migrations and start server)

docker-compose up --build

Now you're ready to go. Open your browser: http://localhost:8000

Extra [recommended] steps

Make sure you have installed:

  • PyLint to help you with some syntax errors
  • autopep8 to beautify your code

Git flow

To file a new a feature

  • create a branch from master branch. Use the pattern: feature/description
  • file a pull request on master branch
  • since your PR is aproved, it will be merged to master branch
  • in a moment in time we'll create a release, using the pattern: release/vX.X.X

Patterns

These are some of patterns definitions to help us to keep a default arquitecture.

  • Recommended editor: VS Code, use Python extension by Microsoft
  • Package manager: PyPI, sure
  • Python version: v3.8.x
  • Python Framework: Flask framework
  • Python server:
  • Linter: PyLint
  • Formater: autopep8
  • Database:
  • Migrations: Run on a container described in docker-compose file: image image
  • i18n:
  • Date and time:
  • Test:
  • Logs:
  • Http Request:
  • Authentication:
  • SMTP email:
  • XLS sheets:
  • Docker compose and dockerfile attached running migrations e starting database and python server

Project structure

Basic folder structure

pending definition

  • src/api: Endpoints and business logic
  • src/static: Images, styles, fonts and other files that can be served
  • src/routes: Routes, :]
  • src/templates: mustache interpreted files
  • src/test: Unity tests
  • src/utils: App config, constants, configuration and i18n, utilities and modules superior layer implementations