Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/8area8/plenkton-api
Plenkton-api
https://github.com/8area8/plenkton-api
Last synced: 3 days ago
JSON representation
Plenkton-api
- Host: GitHub
- URL: https://github.com/8area8/plenkton-api
- Owner: 8area8
- License: mit
- Created: 2022-02-12T20:09:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T01:35:54.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T02:56:45.987Z (7 months ago)
- Language: Python
- Size: 84.5 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# plenkton-api
Plenkton-api
## Workflow
We use Docker in development
### Install
This project only uses Docker to develop and deploy the application.
- Use [VSCode remote container](https://code.visualstudio.com/docs/remote/containers) to build and launch the application.
- Install a local docker volume. Open your Shell on local, and write `docker volume create pgplenkton`### Usage
- You can now access to localhost:8000
- Migrate your database (see [migration part](#Migrations))
- Optional: add the admin user from `commands.ipnb`## Google Cloud Storage
We use Google Cloud storage to send the `dist` folder to the cloud.
The production configuration replace the `static/` prefix by the google cloud storage url.- Install [Google Cloud Console](https://cloud.google.com/sdk/docs/install#deb).
- Create a bucket.
- Render the [bucket public](https://cloud.google.com/storage/docs/access-control/making-data-public?hl=fr)
- Import files/folder from [command line](https://cloud.google.com/storage/docs/uploading-objects#prereq-cli)### Be sure your CI works
- We use the [upload cloud storage](https://github.com/google-github-actions/upload-cloud-storage) action.
- Add a Github secret variable `GCP_CREDENTIALS` to connect to google cloud from your local machine and from the CI ([generate a key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys), [access to your service accounts](https://console.cloud.google.com/iam-admin/serviceaccounts?referrer=search&project=plenkton)).
- Add a Github secret variable `CLOUD_BASE_URL` to translate the `static` prefix into `https://storage.googleapis.com//dist/` when you build the `dist` folder.## Deploy to Heroku
We deploy to heroku using the `.heroku.yml`. `Procfile` is not required. ;)
- Use heroku cli to login : `heroku login`
- Add your remote to git : `heroku git:remote -a plenkton`
- Set the container stack: `heroku stack:set container`
- Set env variable `DEBUG` to False on Heroku: `heroku config:set DEBUG=False`
- Configure the automatic deployment by [linking heroku to your github account](https://devcenter.heroku.com/articles/github-integration).## Environment variables
Add a `.env` at the root:
```ini
CLOUD_BASE_URL=dataAUTH0_AUDIENCE=data
AUTH0_ISSUER=data
AUTH0_DOMAIN=data
AUTH0_ALGORITHMS=dataAUTH0_CLIENT_ID=data
AUTH0_CLIENT_SECRET=data
```Add a `.env` in `./front`:
```ini
VUE_APP_CLOUD_BASE_URL=dataVUE_APP_AUTH0_AUDIENCE=data
VUE_APP_AUTH0_ISSUER=data
VUE_APP_AUTH0_FRONT_ID=data
```## Migrations
Use alembic to handle database migrations :
- `alembic revision -m `: make migrations
- `alembic downgrade `: downgrade to version
- `alembic history`: show history