lsts-svelte Svelte Themes

Lsts Svelte

Local Stock Tracking System - This is a remake of the original project with Svelte (TypeScript) and MongoDB

LSTS - Svelte Remake

Local Stock Tracking System

This is a remake of LSTS made with sveltekit and using a api that gets data from MongoDB.

Tracks the stock of local pharmacies to help people find their medicine easier

  • Track items availability in drug stores near you
  • Spend less time searching for the right place to get your meds
  • Helps you use your time with more efficiency

Valuable information

  • This version is written in Svelte (Typescript) and is not complete nor secure.
  • This version needs a api that returns a special json to function, a example api code in python using flask: ```python from flask import Flask, jsonify from flask_pymongo import PyMongo from flask_cors import CORS from pymongo.errors import PyMongoError

app = Flask(name) app.config['MONGO_URI'] = 'MONGODB_CONNECT_STRING' mongo = PyMongo(app)

@app.route('/api/', methods=['GET']) def get_documents(unit): try: collection = mongo.db.remedios documents = collection.find({'unit': unit})

    result = []
    for doc in documents:
        result.append({
            '_id': str(doc['_id']),
            'name': doc['name'],
            'quant': doc['quant']
        })

    return jsonify(result)
except PyMongoError as e:
    return str(e), 500

if name == 'main': CORS(app) app.run(host='localhost', port=8888)

- The collection name in your MongoDB database needs to be "remedios" or you can change the code of course.
- This is the standard this particular script is expecting:
```nosql
{
  "_id": Integer,
  "unit": String,
  "name": String,
  "quant": Integer
}

Features

  • Automagically gets the latest availability data and prices

Warning

:warning: This is a PoC project for educational purposes only: We don't provide any support, use at your own risk!

Important

  • LSTS - Svelte Ramake requires Svelte, NPM

Run

npm run dev -- --open

License

GPL v3

Top categories

Loading Svelte Themes