-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
488 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SECRET_KEY='DEVElOPMENTONLY' | ||
SQLALCHEMY_DATABASE_URI='postgresql://usr:pwd@postgres:5432/master' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
|
||
|
||
class Config(object): | ||
SECRET_KEY = os.getenv('SECRET_KEY') | ||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI') | ||
FLASK_ENV = 'development' | ||
DEBUG = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
import os | ||
# flake8: noqa | ||
# pylint: skip-file | ||
|
||
from flask import Flask | ||
from flask_cors import CORS | ||
from flask_bcrypt import Bcrypt | ||
from flask_sqlalchemy import SQLAlchemy | ||
from sqlalchemy.orm import DeclarativeBase | ||
from config import Config | ||
|
||
|
||
app = Flask(__name__) | ||
CORS(app) | ||
app.config.from_object(Config) | ||
app.app_context().push() | ||
|
||
bcrypt = Bcrypt(app) | ||
|
||
|
||
def create_app(): | ||
app = Flask(__name__) | ||
CORS(app) | ||
return app | ||
class Base(DeclarativeBase): | ||
pass | ||
|
||
|
||
db = SQLAlchemy(model_class=Base) | ||
db.init_app(app) | ||
|
||
from pollination import routes # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from uuid import uuid4 | ||
from pollination import db | ||
import string | ||
import random | ||
|
||
|
||
''' | ||
BELOW THIS ARE EXAMPLES | ||
''' | ||
|
||
|
||
def get_uuid(): | ||
'''Returns a unique id in hex''' | ||
return uuid4().hex | ||
|
||
|
||
def get_basic_id(): | ||
'''Returns a unique id of easy typeable string''' | ||
return ''.join(random.choices(string.ascii_uppercase | ||
+ string.ascii_lowercase, k=6)) | ||
|
||
|
||
class Team(db.Model): | ||
''' | ||
Only allows people with the team id to create an account | ||
''' | ||
__tablename__ = "team" | ||
id = db.Column(db.String(32), primary_key=True, | ||
unique=True, default=get_uuid) | ||
alt_id = db.Column(db.String(6), unique=True, default=get_basic_id) | ||
|
||
team_name = db.Column(db.String(20), unique=True) | ||
track_value = db.relationship('Track_value', back_populates='team') | ||
|
||
user = db.relationship('User', back_populates='team') | ||
# Determine what access level the function is at | ||
|
||
def __repr__(self): | ||
return f"Team('{self.team_name}','{ self.alt_id }')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# from flask import request, jsonify | ||
from pollination import app # , bcrypt, db | ||
|
||
|
||
@app.route('/api/test', methods=['GET', 'POST']) | ||
def test(): | ||
return "This works" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:22-alpine | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import Image from "next/image"; | ||
|
||
export default function Test() { | ||
return ( | ||
<main> | ||
<div> | ||
<p> | ||
Get started by editing | ||
<code>src/app/page.js</code> | ||
</p> | ||
<div> | ||
<a | ||
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
By{" "} | ||
<Image | ||
src="/vercel.svg" | ||
alt="Vercel Logo" | ||
width={100} | ||
height={24} | ||
priority | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<Image | ||
src="/next.svg" | ||
alt="Next.js Logo" | ||
width={180} | ||
height={37} | ||
priority | ||
/> | ||
</div> | ||
|
||
<div> | ||
<a | ||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Docs <span>-></span> | ||
</h2> | ||
<p>Find in-depth information about Next.js features and API.</p> | ||
</a> | ||
|
||
<a | ||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Learn <span>-></span> | ||
</h2> | ||
<p>Don't Do THIS Learn about Next.js in an interactive course with quizzes!</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Templates <span>-></span> | ||
</h2> | ||
<p>Explore starter templates for Next.js.</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Deploy <span>-></span> | ||
</h2> | ||
<p> | ||
Instantly deploy your Next.js site to a shareable URL with Vercel. | ||
</p> | ||
</a> | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
"@/*": ["./app/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
rewrites: async () => { | ||
return [ | ||
{ | ||
source: '/api/:path*', | ||
destination: 'http://back-end:5000/api/:path*' | ||
}, | ||
] | ||
}, | ||
}; | ||
|
||
export default nextConfig; |