Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 22 20:35
  • Apr 22 13:16
    We-Gold starred GenieFramework/Genie.jl
  • Apr 22 06:08
    ProvocaTeach starred GenieFramework/Genie.jl
  • Apr 22 00:34
    psheill starred GenieFramework/Genie.jl
  • Apr 21 18:35
    danillolima starred GenieFramework/Genie.jl
  • Apr 21 14:02
  • Apr 21 10:27
    essenciary commented #359
  • Apr 21 10:21
    yakir12 commented #359
  • Apr 21 10:21
    essenciary commented #359
  • Apr 21 10:19
    essenciary commented #359
  • Apr 21 10:16
    essenciary commented #359
  • Apr 21 10:14
    essenciary commented #359
  • Apr 21 09:39
    yakir12 commented #359
  • Apr 21 09:35
    yakir12 commented #359
  • Apr 21 09:23
    yakir12 commented #359
  • Apr 21 09:13
    yakir12 commented #359
  • Apr 21 08:40
    yakir12 commented #359
  • Apr 21 08:39
    yakir12 commented #359
  • Apr 21 08:32
    essenciary commented #359
  • Apr 21 08:31
    essenciary commented #359
Adrian Salceanu
@essenciary
the julia> cursor should then turn green
no problem
Daniel Molina
@dmolina
One last question, the best way to run a template is html(path"templates/...")?
It for a global html, not related with a simple view
Adrian Salceanu
@essenciary
yes, that should be fine 👍
Daniel Molina
@dmolina
Gracias/Thank you
Adrian Salceanu
@essenciary
de nada
Daniel Molina
@dmolina
One think, are you open to add more options to SearchLights, like unique?
I add them with the additional string in column function
But I think that could be nice
Adrian Salceanu
@essenciary
yes, for sure - also, a few more aggregates could be added. the thing is however that ideally should support all 3 backends (mysql, postgres, sqlite). of course, we could also add them to SearchLight and then to at least one backend - but ideally we should add to all soon, at this point all the API is cross-DB
Daniel Molina
@dmolina
Yes, I was thinking in general options available to all backends.
Ok, I continue working in my web, I could do PRs to add them later.
Adrian Salceanu
@essenciary
awesome! also @FrankUrbach has done a lot of valuable work on SearchLight, that needs to be merged - maybe he can chime in, some of these might already be implemented by him
Frank Urbach
@FrankUrbach
@dmolina If you guide me to your path where I can see what you are trying to achieve, it should be possible to work on some functions you need.
Daniel Molina
@dmolina
Ah, it is simple:
@FrankUrbach I have to put column(:name, :string, limit=30, "UNIQUE") to allow unique in the database
@FrankUrbach and for foreign key column(:benchmark_id, :string, limit=30, "REFERENCES benchmark(id)"), but it is more complex and it is not so simple.
Frank Urbach
@FrankUrbach
@essenciary If you give me a hint, what kind of databases you want also support, it should be not that difficult to bring this to life. The Oracle Searchlight addapter needs a little bit more work but it not so much. Then you could add it as an option as data backend.
Daniel Molina
@dmolina
@FrankUrbach ok, I was working with SQLite, but I think that the same code could work for the other databases
Frank Urbach
@FrankUrbach
@dmolina The first is not that hard. As I remember correctly only the limit clause isn't there today. If you have an implementation in the SqlLite-Adapter it would be nice if you file a PR to the SearchLightSQLite-Adapter and let me know about it. Then we can discuss this and can implement it in the other three adapters. So we can keep the divergence between the three(four) adapters as small as possible. Plesase feel free contact me even on Discord: https://discord.com/channels/774897545717219328/774897827531718656 in the Genie-Section or private on Discord (franku#9311).
Frank Urbach
@FrankUrbach
@dmolina What your are trying to reach with the foreign key clause. If you try to nest structs, you can't do that with the current master yet. I have realized this in my fork, which still needs to be merged into the official repository. If you could elaborate a little bit more what's the goal of your foreign key is maybe I could help out with an idea.
Daniel Molina
@dmolina
@FrankUrbach not, only to define foreign key in the creation of table, only that. I know there is not nest struct in the current implementation. My website add the data, and the foreign key is only for give a little more of security in the data.
Frank Urbach
@FrankUrbach
How about an index. The function add_index(table_name, column_name, name, unique, order) should do what you want.
Daniel Molina
@dmolina
@FrankUrbach Thank you, I didn't know that add_index could do it, I though that was only useful to increase the performance of queries
Frank Urbach
@FrankUrbach
Your are welcome.
agathe le galiot
@agatheLG_gitlab
Hi, I am currently using Genie as a backend. At one point (during email confirmation) I want to be redirected to a page in my front end. However the redirect() function in Genie keeps me in the Genie server... Would anyone have an idea on how to be redirected to another server ?
1 reply
Test IP
@ipt2000_gitlab
I'm new to Genie and Stipple. I have a simple but silly question. I check the StippleDemos, how to combine two apps into one project with two diffierent url, ie /app1 route to HelloStipple, /app2 route to StippleButtons.
14 replies
Graham Smith
@grahamas
How do you load a package in a view.jl.html? Right now I'm passing in a package that I load in my controller through a keyword argument to html, but that feels... wrong.
4 replies
Yueh-Hua Tu
@yuehhua
Hi! I and my friend are trying Genie for visualizing a scientific project. We want to plot using Plots.jl (or maybe other visualization package) and put the plot on web page. Is there a way to plot with Genie?
12 replies
Ciarán O'Mara
@CiaranOMara
Are there documented column_types?
Ciarán O'Mara
@CiaranOMara
Found SearchLightSQLite.TYPE_MAPPINGS. Presumably the same is available for other databases.
Frank Urbach
@FrankUrbach
Yes. You are right. You will find these type mappings in each available adapter because it is database dependend.
George
@george-githinji
I am new to Genie but not new to MVC frameworks , having used and deployed Rails in a previous lifetime. I am going through the tutorial,and ran into :"julia> SearchLight.Migration.create_migrations_table()
ERROR: MethodError: no method matching create_migrations_table()
Stacktrace:
[1] top-level scope
@ REPL[6]:1
"
Frank Urbach
@FrankUrbach
HI George
This is not that difficult to solve. The following hints should help:
conn_info_mydb = SearchLight.Configuration.load(path_to_your/databaseconfig.yml)
conn = SearchLight.connect(conn_info_mydb)
the first line reads the yml file which contains the informations for your database. The content differs from database to database. For now MySQL, Postgresql and SQLite. Therefore the corresponding SearchLight-adapter exists.
The second line connects SearchLight to the database.
If you have more problems feel free to ask anytime. Maybe you have a look at Discord. There are is a Julia channel and also a Genie channel. Maybe you are interested in.
Nicholas Ritchie
@NicholasWMRitchie
I'm trying to combine Sessions with multiple Stipple pages to create an elegant multi-page website to collect and present data to multiple simultaneous users. I think I understand that Sessions map user's cookies to Session objects describing the users state on one or more pages. I can build stand alone Stipple pages. However, when I combine the two it almost works. I can open two distinct pages associated with the same Session but one stops communicating with the server. State data isn't being stored between refreshes even when the ReativeModel is stored in Session data and the cookie doesn't change. Can anyone point towards an example that might help me to figure out what I'm doing wrong? Thanks!!
Adrian Salceanu
@essenciary
@NicholasWMRitchie can you please open an issue with a minimum working example?
Nicholas Ritchie
@NicholasWMRitchie
Thanks @essenciary, I've created an issue on the Stipple repo. I suspect that I just don't know what I'm doing :smiley:
Tristan Carion
@tcarion

Hi all,

I have experienced some strange behaviours using the @foreach macro in a html view. Using the example of the doc, if I adapt the Books view this way :

<ul>
  <% @foreach(books) do book %>
    <li>$(book.title) by</li>
    <p> $(book.author) </p>
  <% end %>
</ul>

What I get on page is only the last element in the @foreach loop, i.e., here I only get the p element with the book author. No matter how many siblings elements are in the @foreach, only the last one is rendered.

I ended up working around the problem using partials, but I would like to understand why this doesn't work and if I could do it without using partials. Thanks in advance !

5 replies
Shum
@Shum88
Hi All, I follow Genie document Developing MVC web applications step by step and finished the example with in VSCode ... My question is ... How to restart the generated sample web application insie VS Code ?
27 replies
Shum
@Shum88
Watchtonight_001.jpg
Shum
@Shum88
Watchtonight_002.jpg
Shaan
@shanexavier313

hello :wave: I'm brand new to exploring Genie and Julia and have been following this tutorial to get setup with Genie + MySQL + Docker. Followed the steps which are the same as the Genie docs for working with Docker., but am getting the following error when running docker compose up

app_1  |
app_1  |  _____         _
app_1  | |   __|___ ___|_|___
app_1  | |  |  | -_|   | | -_|
app_1  | |_____|___|_|_|_|___|
app_1  |
app_1  | | Web: https://genieframework.com
app_1  | | GitHub: https://github.com/genieframework/Genie.jl
app_1  | | Docs: https://genieframework.github.io/Genie.jl/dev
app_1  | | Gitter: https://gitter.im/essenciary/Genie.jl
app_1  | | Twitter: https://twitter.com/GenieMVC
app_1  |
app_1  | Genie v1.18.1
app_1  | Active env: DEV
app_1  |

app_1  | Ready!
app_1  |
app_1  | ERROR: LoadError: ArgumentError: invalid base 10 digit 't' in "true"
app_1  | Stacktrace:
app_1  |  [1] tryparse_internal(#unused#::Type{Int64}, s::String, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
app_1  |    @ Base ./parse.jl:137
app_1  |  [2] parse(::Type{Int64}, s::String; base::Nothing)
app_1  |    @ Base ./parse.jl:241
app_1  |  [3] parse
app_1  |    @ ./parse.jl:241 [inlined]
app_1  |  [4] execute(config::Genie.Configuration.Settings; server::Nothing)
app_1  |    @ Genie.Commands ~/.julia/packages/Genie/Uvtzb/src/Commands.jl:21
app_1  |  [5] #run#31
app_1  |    @ ~/.julia/packages/Genie/Uvtzb/src/Genie.jl:231 [inlined]
app_1  |  [6] genie(; context::Module)
app_1  |    @ Genie ~/.julia/packages/Genie/Uvtzb/src/Genie.jl:269
app_1  |  [7] main()
app_1  |    @ App ~/app/src/App.jl:8
app_1  |  [8] top-level scope
app_1  |    @ ~/app/bootstrap.jl:4
app_1  | in expression starting at /home/genie/app/bootstrap.jl:4
app_1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)

Seems this line in the generated App.jl is whats erroring out

# src/App.jl
function main()
  # ...
  Genie.genie(; context = @__MODULE__)

Here is my Dockerfile and docker-compose.yml for reference:

# app/Dockerfile
FROM julia:latest

# user
RUN useradd --create-home --shell /bin/bash genie

# app
RUN mkdir /home/genie/app
COPY . /home/genie/app
WORKDIR /home/genie/app

RUN chown genie:genie -R *

RUN chmod +x bin/repl
RUN chmod +x bin/server
RUN chmod +x bin/runtask

USER genie

RUN julia -e "using Pkg; Pkg.activate(\".\"); Pkg.instantiate(); Pkg.precompile(); "

# ports
EXPOSE 8000
EXPOSE 80

# websockets ports
EXPOSE 8000
EXPOSE 80

ENV JULIA_DEPOT_PATH "/home/genie/.julia"
ENV GENIE_ENV "dev"
ENV HOST "0.0.0.0"
ENV PORT "8000"
ENV PORT "true"

CMD ["bin/server"]
# docker-compose.yml
version: '3'
networks:
  backend:
  frontend:
services:
  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: unless-stopped
    volumes:
      - ./db:/var/lib/mysql
    env_file:
      - ./.env
    networks:
      - backend
  app:
    build:
      context: app
      dockerfile: Dockerfile
    restart: unless-stopped
    ports:
      - "8000:8000"
      - "80:80" #or 81:80 if Genie.jl is used as only as a backend
    env_file:
      - ./.env
    volumes:
      - ./app:/home/genie/app
    entrypoint:
      - bin/server
    networks:
      - backend
      - frontend
    depends_on:
      - db
4 replies
Nicholas Ritchie
@NicholasWMRitchie
@essenciary, I'm trying to decide what to do next. Around 7-Apr, I'd run into a problem using Stipple in a multi-session environment and so I'd asked a question on this channel and submitted an issue in the Stipple repo. I'm still stuck and I don't know whether the problem is me or a shortcoming in Stipple. Can you take a look at the issue and provide a little guidance. I've been stuck for two weeks and need a little insight to decide what to do next. Thanks.
3 replies
jtrakk
@jtrakk
"For the above to work, we also need to tell Genie how to perform the conversion: convert(::Type{Int}, s::SubString{String}) = parse(Int, s)" but I didn't do that and it works anyway
1 reply
jtrakk
@jtrakk
What is the difference between @foreach and Base.map?
1 reply
jtrakk
@jtrakk
I like the idea of minimizing js usage. I see there are a few tools for doing work server-side. https://hotwire.dev/ is made by some ruby folks, https://htmx.org/ is by the intercooler.js author, and https://github.com/kasta-ua/twinspark-js is like htmx but with some improvements such as removing inheritance (https://solovyov.net/blog/2020/a-tale-of-webpage-speed-or-throwing-away-react/). Anybody used those with Genie?
4 replies
jtrakk
@jtrakk
Does string(x) automatically get called on the output of a view function? Sometimes if I return a non-string by accident I'd like to get an error instead of silently rendering an object.
12 replies
jtrakk
@jtrakk
I sometimes get 404, I think it's when there are errors in my controller functions, but I don't see an error message in the repl, other than 404
8 replies
jtrakk
@jtrakk
setfield! immutable struct of type Book cannot be changed
to_model(::Type{Books.Book}, ::DataFrames.DataFrameRow{DataFrames.DataFrame,DataFrames.Index})
is it possible to use immutable struct models?